Passed
Push — master ( e95921...ddbd1b )
by Dimas
13:28 queued 05:15
created

index.js ➔ show_install   A

Complexity

Conditions 5

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 2
c 0
b 0
f 0
dl 0
loc 3
rs 9.3333
1
$(document).ready(function () {
2
  if (typeof Worker !== "undefined") {
3
    console.log("Web Worker Supported");
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
4
    const myWorker = new Worker("/assets/js/worker.js");
5
    myWorker.postMessage([100, 20]);
6
    myWorker.onmessage = function (e) {
7
      //result.textContent = e.data;
8
      console.log("Message received from worker", e);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
9
    };
10
  } else {
11
    console.error("Web Worker not support");
12
  }
13
14
  $(document).on("click", '[data-toggle="ajax"]', function (e) {
15
    e.preventDefault();
16
    const t = $(this);
17
    var method = t.data("method") || "POST";
18
    var data = t.data("postdata");
19
    var target = t.data("href");
20
    var success = t.data("success");
21
    var failed = t.data("failed");
22
    var complete = t.data("complete");
23
    ajx(
24
      {
25
        url: target,
26
        data: data,
27
        method: method,
28
      },
29
      success,
30
      failed,
31
      complete
32
    );
33
  });
34
});
35
36
function show_install(res) {
37
  console.log(res);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
38
}
39